<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--th:if 用于条件判断-->
<!--th:text 设置元素文本内容-->
<!--${} 访问模型中的变量-->
<div th:if="${success}" th:text="${success}"></div>
<div th:if="${error}" th:text="${error}"></div>
<!--th:object="${user} 把表单和user对象进行绑定-->
<form action="/register" method="post" th:object="${user}">
    <label>账号<input type="text" name="username" th:field = "*{name}"></input></label>
    <label>密码<input type="password" name="password" th:field = "*{password}"></input></label>
    <input type="submit" value="登陆"></input>
</form>
</body>
</html>